// 导入封装的请求实例
import request from '@/utils/request'
// 请求方法
// 1.获取列表数据
export const getPerUserList = params => {
  return request({
    url: '/admin/permission/user',
    method: 'get',
    params
  })
}
// 新增
export const addPerUser = data => {
  return request({
    url: '/admin/permission/user',
    method: 'post',
    data
  })
}

// 获取角色
export const getPerUserRole = () => {
  return request({
    url: '/admin/permission/role',
    method: 'get'
  })
}
// 查询
export const getPerUserInfo = id => {
  return request({
    url: `/admin/permission/user/${id}`,
    method: 'get'
  })
}

// 删除
export const delPerUser = id => {
  return request({
    url: `/admin/permission/user/${id}`,
    method: 'delete'
  })
}
// 编辑
export const editPerUserInfo = data => {
  return request({
    url: `/admin/permission/user/${data.id}`,
    method: 'put',
    data
  })
}
// 修改状态
export const changeStatus = data => {
  return request({
    url: `/admin/permission/user/${data.id}/${data.status}`,
    method: 'get'

  })
}
// upload图片--uploadImg
export const uploadImg = (data) => {
  return request({
    url: `/admin/index/upload?mode=base64&type=image`,
    method: 'post',
    data

  })
}
